    //
//  AboutViewContrller.m
//  Quiz
//
//  Created by AnhLH-Oriolus on 03/08/2011.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "AboutViewContrller.h"
#import "countryquizAppDelegate.h"
#import "MainController.h"

@implementation AboutViewContrller

 // The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
-(id)init{
	self = [super init];
	
	return self;
}


// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
	UIImageView *v = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
	[v setImage:[UIImage imageNamed:@"images/about_background.jpg"]];
	[v setUserInteractionEnabled:YES];
	self.view = v;
	[v release];
	
	
	UIImageView *vBar = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
	[vBar setImage:[UIImage imageNamed:@"images/bar.png"]];
	[vBar setUserInteractionEnabled:YES];
	[self.view addSubview:vBar];
	[vBar release];
	
	FontLabel *titleScore = [[FontLabel alloc] initWithFrame:CGRectMake(0, 0, 320, 50) fontName:@"scoreboard" pointSize:30];
	[titleScore setBackgroundColor:[UIColor clearColor]];
	titleScore.textAlignment = UITextAlignmentCenter;
	titleScore.textColor = [UIColor colorWithRed:243 green:255 blue:62 alpha:1.0];
	titleScore.text = @"About";
	[self.view addSubview:titleScore];
	[titleScore release];
	
	UIImage * img = [UIImage imageNamed:@"images/home_btn.png"];
	UIButton *btnBack = [[UIButton alloc] initWithFrame:CGRectMake(5, 5, 40, 40)];
	[btnBack setBackgroundColor:[UIColor clearColor]];
	[btnBack setImage:img forState:UIControlStateNormal];
	[btnBack addTarget:nil action:@selector(backToMenu) forControlEvents:UIControlEventTouchUpInside];
	[self.view addSubview:btnBack];
	[btnBack release];
	
	
	UILabel *lblAbout = [[UILabel alloc] initWithFrame:CGRectMake(10, 50, 300, 330)];
	[lblAbout setBackgroundColor:[UIColor clearColor]];
	lblAbout.textAlignment = UITextAlignmentCenter;
	lblAbout.numberOfLines = 10;
	lblAbout.textColor = [UIColor colorWithRed:243 green:255 blue:62 alpha:1.0];
	lblAbout.text = @"This game is an application for one who likes football, and wants to test about your team football with many question about football quiz.\n\nThe game has four choice and five clue, player will choose the right answer in 25.0 seconds and each clue will appear in 5.0 seconds count down.";
	[self.view addSubview:lblAbout];
	[lblAbout release];
}

-(void)backToMenu{
	[self.view removeFromSuperview];
	[g_AppDelegate.mainCtrl openMenuViewCtrl];
}
/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
}
*/


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Overriden to allow any orientation.
    return YES;
}


- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc. that aren't in use.
}


- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


- (void)dealloc {
    [super dealloc];
}


@end
